<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <% 
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<base target="<%=basePath %>">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Pragma" content="no-cache">
	<meta http-equiv="Cache-Control" content="no-cache">
	<meta http-equiv="Expires" content="0">
	<!-- <link rel="stylesheet" type="text/css" href="../resources/css/ext-all.css" />
	<script type="text/javascript" src="../js/bootstrap.js"></script>
	<script type="text/javascript" src="../console/Login.js"></script> -->
	
	<script type="text/javascript" src="../js/jquery-1.6.4.js"></script>
	<script type="text/javascript">
		function selectAll() {
			$.post("../admin/onLine.json",{},function(data){
				var obj = $.parseJSON(data);
				$("#table1").empty();
				$("#table2").empty();
				var str1 = "<tr><td>用户名</td><td>主机名</td><td>会议室</td></tr>";
				var str2 = "<tr><td>用户名</td><td>主机名</td></tr>";
				for(var i=0;i<obj.listOnLine.length;i++){
					str1 += "<tr>"+
						   "<td>" + obj.listOnLine[i].userName + "</td>" + 
						   "<td>"+ obj.listOnLine[i].hostName + "</td>"+
						   "<td>"+ obj.listOnLine[i].roomName + "</td>"+
						   "</tr>";
				}
				
				for(var i=0;i<obj.listLostLine.length;i++){
					str2 += "<tr>"+
						   "<td>" + obj.listLostLine[i].userName + "</td>" + 
						   "<td>"+ obj.listLostLine[i].hostName + "</td>"+
						   "</tr>";
				}
				$("#table1").append(str1);
				$("#table2").append(str2);
			});
		}	
	 </script>
</head>
<body>
	<input type="button" value="查询所有用户" onclick="selectAll()" />
	<br/>
	在线用户
	<hr/>
	<table id="table1" border="1">
		<tr>
			<td>用户名</td>
			<td>主机名</td>
			<td>会议室</td>
		</tr>
	</table>
	<br/>
	<hr/>
	掉线用户
	<table id="table2" border="1">
		<tr>
			<td>用户名</td>
			<td>主机名</td>
		</tr>
	</table>
</body>
</html>